﻿-- Define the relationship between PersonMark and Person
ALTER TABLE [dbo].[PersonMark] WITH CHECK ADD  
       CONSTRAINT [FK_PersonMark_CreatedByPerson] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between PersonMark and Person
ALTER TABLE [dbo].[PersonMark] WITH CHECK ADD  
       CONSTRAINT [FK_PersonMark_LastChangedBy] FOREIGN KEY([LastChangedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between PersonMark and Person
ALTER TABLE [dbo].[PersonMark] WITH CHECK ADD  
       CONSTRAINT [FK_PersonMark_Person] FOREIGN KEY([Person])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between PersonMark and Mark
ALTER TABLE [dbo].[PersonMark] WITH CHECK ADD  
       CONSTRAINT [FK_PersonMark_Mark] FOREIGN KEY([Mark])
REFERENCES [dbo].[Mark] ([MarkId])
ON DELETE NO ACTION
GO
